<?php

namespace App\Services;

use App\Models\AttendanceGroup;

class AttendanceGroupService
{
    public function get($title)
    {
        $sql = AttendanceGroup::when($title, function ($query, $title) {
            return $query->where(function ($query) use ($title) {
                $query->where('name', 'like', '%' . $title . '%');
            });
        });
        return $sql;
    }
}
